<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<head>
<title>Market place</title>
</head>
<f:view>
	<body>
		<ui:composition template="/templates/adminTemplate.xhtml">
			<ui:define name="content">

				<div id="center">
					<h:form prependId="false" id="detailForm">
						<h:panelGrid columns="1">
							<h:panelGrid columns="7" style="width:100%; font-size:0.9em;">
								<p:commandButton ajax="true" value="Reload"
									update=":detailForm:userRecordsTable" style="float:left"
									actionListener="#{reportController.loadUserActivityRecords}" />
								<h:outputText value="Required date:"></h:outputText>
								<h:outputText value="From:"></h:outputText>
								<p:calendar value="#{reportModel.userRecordQuery.startDate}" />
								<h:outputText value="To:"></h:outputText>
								<p:calendar value="#{reportModel.userRecordQuery.endDate}" />
								<h:outputText
									value="Calculate all orders exclude Canceled order"></h:outputText>
							</h:panelGrid>

							<p:dataTable id="userRecordsTable" var="record" sortBy="1"
								value="#{reportModel.userRecords}" paginator="true" rows="50"
								filterEvent="enter"
								rowsPerPageTemplate="5,7,10,15,20,30,40,50,100,150,200,250,300,400,500"
								paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">

								<p:column sortBy="#{record.firstName}"
									filterBy="#{record.firstName}" filterMatchMode="contains">
									<h:outputText value="#{record.firstName}" />
								</p:column>
								<p:column sortBy="#{record.lastName}"
									filterBy="#{record.lastName}" filterMatchMode="contains">
									<h:outputText value="#{record.lastName}" />
								</p:column>
								<p:column sortBy="#{record.email}"
									filterBy="#{record.email}" filterMatchMode="contains">
									<h:outputText value="#{record.email}" />
								</p:column>
								<p:column sortBy="#{record.telephone}"
									filterBy="#{record.telephone}" filterMatchMode="contains">
									<h:outputText value="#{record.telephone}" />
								</p:column>

								<p:column sortBy="#{record.recordDate}"
									filterBy="#{record.recordDate}" filterMatchMode="contains">
									<h:outputText value="#{record.recordDate}" />
								</p:column>
								<p:column sortBy="#{record.type}" filterBy="#{record.type}"
									filterMatchMode="contains">
									<h:outputText value="#{record.type}" />
								</p:column>
								<p:column sortBy="#{record.comments}"
									filterBy="#{record.comments}" filterMatchMode="contains">
									<h:outputText value="#{record.comments}" />
								</p:column>
							</p:dataTable>
						</h:panelGrid>
					</h:form>
				</div>
			</ui:define>
		</ui:composition>
	</body>
</f:view>
</html>